local plug = {}

plug.Name = "Kick"
plug.Author = "Michael Johnson"
plug.File = sledge.PlugFile
plug.ClientSide = true
plug.ServerSide = true
plug.Enabled = true
plug.Commands = {"kick"}
function plug.CallCommand(ply, cmd, args)
	if(!plug.Enabled) then
		sledge.Msg(ply, "The kick module ("..plug.File..") has been disabled.")
		return false
	end
	if(!sledge.CheckPerms(ply, "kick")) then
		sledge.Msg(ply, "Access denied.")
		return false
	end
	if(args[1] == "kick") then
		if(args[2] != nil) then
			local kickee = sledge.findplayer(args[2])
			if(ply == kickee) then
				sledge.Msg(ply, "Can not kick yourself.")
				return false
			end
			if(kickee == false) then
				sledge.Msg(ply, "Could not match \""..args[2].."\"")
				return false
			end
			print(kickee)
			kickee:Kick(args[3] or "No reason")
			sledge.MsgAll(ply:Nick().." has kicked "..kickee:Nick().." ("..args[3] or "No Reason"..")")
		else
			sledge.Msg(ply, "Usage: "..cmd.." "..args[1].." <user> [reason]")
		end
	end
	return true
end
sledge.LoadPlug(plug)